<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/jquery-3.2.1.js"></script>
     <style>
        *{margin: 0;padding: 0;}
         .content{
            width: 400px;
            height: 400px;
            position: relative;
         }
         .content>div{
             width: 100%;
             height: 100%;
             position: absolute;
         }
         .login{
             background-color: red;
         }
         .saoma{
             background-color: yellow;
             z-index: 100;
         }
         .curent{
             color: orangered;
         }
     </style>
</head>
<body>
    <div>
        <ul class="nav">
            <li class="curent">扫码登录</li>
            <li>账号登录</li>
        </ul>
        <div class="content">
          <div class="login">
             login
          </div>
          <div class="saoma">
             saoma
          </div>
        </div>
    </div>
    <script>
      $(".nav li").click(function(){
          $(this).addClass("curent").siblings().removeClass("curent");
          let index = $(this).index();
          console.log(index);
          $(".content>div").eq(index).show().siblings().hide();
      })
    </script>
</body>
</html>